//index.js
//获取应用实例
const app = getApp()
var CONFIG = require("../../config/config.js");
var share = require('../../utils/share.js');
Page({
    data: {
        firstfalse: false,
        secfalse: true,
        threefalse: false,
        data:[],
        img: CONFIG.API_PIC,
        msg:'',
        status:1001,
        navarrobj: {},
        everychild:[],
        tanfalse: false,
    },

    evclick(e){
        var that = this;
        var item = e.currentTarget.dataset.item;
        // console.log(item)
        var name = item.name;
        if (name =='courselist'){
            wx.navigateTo({
                url: '/pages/apply/choosecourselist/choosecourselist?type=3',
            })
        } else if (name == 'orderlist') {
            wx.navigateTo({
                url: '/pages/staff/newmyyeji',
            })
        } else if (name == 'changelist') {
            wx.navigateTo({
                url: '/pages/staff/allcourse?type=2',
            })
        } else if (name == 'withlist') {
            wx.navigateTo({
                url: '/pages/staff/allcourse?type=1',
            })
        } else if (name == 'thcourse') {
            wx.navigateTo({
                url: '/pages/staff/allcourse?type=1',
            })
        } else if (name == 'custquery' || name == 'custqueryNew') {
            wx.navigateTo({
                url: '/pages/staff/customSearch',
            })
        } else if (name == 'outstand'||name=='querybill') {
            wx.navigateTo({
                url: '/pages/staff/truemyyeji?teamtype=1',
            })
        } else if (name == 'teamperson') {
            wx.navigateTo({
                url: '/pages/myteam/people/teampeople',
            })
        } else if (name == 'teamoutstand') {
            wx.navigateTo({
                url: '/pages/staff/truemyyeji?teamtype=3',
            })
        } else if (name == 'teamuser') {
            wx.navigateTo({
                url: '/pages/staff/mycustom?teamtype=3',
            })
        } else if (name == 'qureyClass' || name == 'queryclass') {
            wx.navigateTo({
                url: '/pages/apply/find/finddesc?type=5',
            })
        } else if (name == 'thcourse') {
            wx.navigateTo({
                url: '/pages/staff/allcourse?type=1',
            })
        } else if (name == 'reportList') {
            wx.navigateTo({
                url: '/pages/staff/report',
            })
        } else if (name == 'auditList') {
            wx.navigateTo({
                url: '/pages/staff/approve',
            })
        }else if(name == 'querycourse'){
            wx.navigateTo({
                url: '/pages/apply/search/searchcourse',
            })
        }else if(name == 'myclass'){
            wx.navigateTo({
                url: '/pages/apply/find/finddesc?is_class=2&type=5',
            })
        }else if(name == 'data'){
            wx.navigateTo({
                url: '/pages/activitydata/activityindex',
            })
        }else if(name == 'queryclassjn'){
            wx.navigateTo({
                url: '/pages/apply/skill/searchclass?type=5',
            })
        }else if(name == 'pullgroup'){
            wx.navigateTo({
                url: '/pages/apply/group/pullgroup?type=3',
            })
        }
    },



    // 在开放
    nofangclick(e){
        // console.log(e);
        var that = this;
        var url = e.currentTarget.dataset.url;
        if(url!=''){
            wx.navigateTo({
                url: url,
            })
        }else{
            wx.showToast({
                title: '正在开发，敬请期待~',
                icon: 'none',
                duration: 1500
            })
        }
    },
  
    onLoad: function () {
        var that = this;
        wx.showLoading({
            title: '加载中~',
        })

        // wx.onUserCaptureScreen(function (res) {
        //     console.log('用户截屏了')
        // })

        // wx.setVisualEffectOnCapture({visualEffect:"hidden"});
        var navarr = JSON.parse(wx.getStorageSync('navarr'));
        var item = '';
        for (var i = 0; i < navarr.length; i++) {
            if (navarr[i].name == 'apply') {
                item = navarr[i];
            }
        }
        var obj = {
            navarr: navarr,
            typestatus: 'apply',
        }
        that.setData({
            navarrobj: obj,
            everychild: item.children,
            tanfalse: true,
        })
        wx.hideLoading();
    },

    onShow(){
        wx.removeStorageSync('keyapprolal')
        wx.removeStorageSync('keylistphone')
        wx.removeStorageSync('keywordphone')
    }
 
})
